home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Utilities
/
Text Processing
/
Alpha
/
LaTeX
/
latex 2.09
/
smart.tcl
< prev
Wrap
Text File
|
1994-10-13
|
707b
|
43 lines
proc literalDQuote {} {
return [expr {[lookAt [expr [getPos]-1]] == "\\"}]
}
proc smartDQuote {} {
global smartQuotes
if {!$smartQuotes || [literalDQuote]} { insertText {"}; return }
if {[leftQ]} {
insertText {``}
} else {
insertText {''}
}
}
ascii 0x22 <s> smartDQuote TeX
proc smartQuote {} {
global smartQuotes
if {!$smartQuotes} { insertText {'}; return }
if {[leftQ]} {
insertText {`}
} else {
insertText {'}
}
}
ascii 0x27 smartQuote TeX
proc leftQ {} {
if {[getPos] == 0} {return 1};
set q [lookAt [expr [getPos]-1]]
case $q in {
{\t} {return 1}
{(} {return 1}
{\{} {return 1}
{[} {return 1}
{<} {return 1}
{\ } {return 1}
{\r} {return 1}
}
return 0
}